package com.song.yunpicturebackend.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.song.yunpicturebackend.model.dto.space.SpaceAddRequest;
import com.song.yunpicturebackend.model.entity.Space;
import com.song.yunpicturebackend.model.entity.User;

public interface SpaceService extends IService<Space> {

    /**
     * 空间创建或修改数据校验
     * @param space
     * @param add
     */
    void validSpace(Space space, boolean add);

    /**
     * 根据传入的空间级别自动分配空间大小
     * @param space
     */
    void fillSpaceBySpaceLevel(Space space);

    /**
     * 新增空间
     * @param spaceAddRequest
     * @param loginUser
     * @return
     */
    long addSpace(SpaceAddRequest spaceAddRequest, User loginUser);
}
